<?php
namespace app\api\controller;

use think\Controller;
use think\facade\Session;
use think\Request;

class Order extends Controller
{
    public function payStatus(Request $request)
    {
        $id = $request->param('id', 0,'intval');
        if (!$id)
        {
            return show(0, 'error');
        }

        if (!Session::get('o2o_user', 'o2o'))
        {
            $this->error('请登录', 'index/user/login');
        }

        $order = model('Order')->get($id);
        if ($order['pay_status'] == 1)
        {
            return show(1, 'success');
        }
        return show(0, 'error');

    }
}
